/**
 * 
 */

package com.chengyu.eyc.enums;

import com.chengyu.eyc.base.AbstractEnums;

import cn.hutool.core.util.StrUtil;

/**
 * @author kevin
 *
 */
public enum PayStatusEnum implements AbstractEnums<String>  {

    UNPAID("UNPAID", "未支付"), PAID("PAID", "已支付"), REFUNDING("REFUNDING", "申请退款"), REFUND_COMPLETED("REFUND_COMPLETED", "退款完成"), CLOSED("CLOSED", "交易关闭");

    /**
     * @param payStatus
     * @return
     */
   public static String getPayStatusNme(String payStatus) {
        for (PayStatusEnum payStatusEnum : PayStatusEnum.values()) {
            if(StrUtil.equals(payStatusEnum.getCode(), payStatus)) {
                return payStatusEnum.getName();
            }
        }
        return null;
    }

    private String code;

    private String name;

    PayStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }


}
